_setLabelText(dialog.descriptionLabel, labels[1]);
}
+function _createIcon(gicon) {
+ return new St.Icon({ gicon: gicon,
+ style_class: 'shell-mount-operation-icon' })
+}
+
/* -------------------------------------------------------- */
const ListItem = new Lang.Class({
this.mountOp.connect('aborted',
Lang.bind(this, this._onAborted));
- this._icon = new St.Icon({ gicon: source.get_icon(),
- style_class: 'shell-mount-operation-icon' });
+ this._gicon = source.get_icon();
},
_onAskQuestion: function(op, message, choices) {
- this._dialog = new ShellMountQuestionDialog(this._icon);
+ this._dialog = new ShellMountQuestionDialog(this._gicon);
this._dialog.connect('response',
Lang.bind(this, function(object, choice) {
_onAskPassword: function(op, message) {
this._notificationShowing = true;
- this._source = new ShellMountPasswordSource(message, this._icon, this._reaskPassword);
+ this._source = new ShellMountPasswordSource(message, this._gicon, this._reaskPassword);
this._source.connect('password-ready',
Lang.bind(this, function(source, password) {
let message = op.get_show_processes_message();
if (!this._processesDialog) {
- this._processesDialog = new ShellProcessesDialog(this._icon);
+ this._processesDialog = new ShellProcessesDialog(this._gicon);
this._dialog = this._processesDialog;
this._processesDialog.connect('response',
Name: 'ShellMountQuestionDialog',
Extends: ModalDialog.ModalDialog,
- _init: function(icon) {
+ _init: function(gicon) {
this.parent({ styleClass: 'mount-question-dialog' });
let mainContentLayout = new St.BoxLayout();
this.contentLayout.add(mainContentLayout, { x_fill: true,
y_fill: false });
- this._iconBin = new St.Bin({ child: icon });
+ this._iconBin = new St.Bin({ child: _createIcon(gicon) });
mainContentLayout.add(this._iconBin,
{ x_fill: true,
y_fill: false,
Name: 'ShellMountPasswordSource',
Extends: MessageTray.Source,
- _init: function(message, icon, reaskPassword) {
+ _init: function(message, gicon, reaskPassword) {
+ this._gicon = gicon;
+
let strings = message.split('\n');
this.parent(strings[0]);
-
- this._notification = new ShellMountPasswordNotification(this, strings, icon, reaskPassword);
- this._setSummaryIcon(icon);
+ this._notification = new ShellMountPasswordNotification(this, strings, reaskPassword);
// add ourselves as a source, and popup the notification
Main.messageTray.add(this);
this.notify(this._notification);
},
+
+ createNotificationIcon: function() {
+ return _createIcon(this._gicon);
+ },
});
Signals.addSignalMethods(ShellMountPasswordSource.prototype);
Name: 'ShellMountPasswordNotification',
Extends: MessageTray.Notification,
- _init: function(source, strings, icon, reaskPassword) {
- this.parent(source, strings[0], null, { customContent: true, icon: icon });
+ _init: function(source, strings, reaskPassword) {
+ this.parent(source, strings[0], null, { customContent: true });
// set the notification to transient and urgent, so that it
// expands out
Name: 'ShellProcessesDialog',
Extends: ModalDialog.ModalDialog,
- _init: function(icon) {
+ _init: function(gicon) {
this.parent({ styleClass: 'show-processes-dialog' });
let mainContentLayout = new St.BoxLayout();
this.contentLayout.add(mainContentLayout, { x_fill: true,
y_fill: false });
- this._iconBin = new St.Bin({ child: icon });
+ this._iconBin = new St.Bin({ child: _createIcon(gicon) });
mainContentLayout.add(this._iconBin,
{ x_fill: true,
y_fill: false,